import {createApp} from 'vue'
import { createPinia } from 'pinia'
import { VueQueryPlugin } from '@tanstack/vue-query'
import { queryClient } from './utils/queryClient'
import App from './App.vue'
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
import router from './router.js'
import api from './api'

// 创建Vue应用
const app = createApp(App)

// 创建Pinia实例
const pinia = createPinia()

// 使用VueQuery
app.use(VueQueryPlugin, {
  queryClient: queryClient,
})

// 使用Pinia
app.use(pinia)

// 使用Ant Design Vue
app.use(Antd)

// 使用路由
app.use(router)

// 挂载应用
app.mount('#app')

// 隐藏加载动画
document.addEventListener('DOMContentLoaded', function() {
  const loading = document.getElementById('loading')
  if (loading) {
    loading.style.display = 'none'
  }
})